package com.zcg.gasmanager.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.zcg.gasmanager.dao.AdminDao;
import com.zcg.gasmanager.dao.LogDao;
import com.zcg.gasmanager.dao.impl.AdminDaoImpl;
import com.zcg.gasmanager.dao.impl.LogDaoImpl;
import com.zcg.gasmanager.model.Admin;
import com.zcg.gasmanager.model.Log;
import com.zcg.gasmanager.service.AdminService;
import com.zcg.gasmanager.utils.VeDate;

@Component("adminService")
public class AdminServiceImpl implements AdminService {
	private AdminDao adminDao;
	private Log log = new Log();
	private LogDao logDao;
	@Override
	@Transactional
	public boolean check(Admin admin){
		log.setMsg(VeDate.getStringDate()+":  login Admin");
		logDao.add(log);
		return adminDao.load(admin);	
	}
	
	public AdminDao getAdminDao() {
		return adminDao;
	}
	
	@Resource
	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}

	public LogDao getLogDao() {
		return logDao;
	}

	@Resource
	public void setLogDao(LogDao logDao) {
		this.logDao = logDao;
	}
	
	
}
